home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / MiamiSDK / netinclude / libraries / usergroup.h < prev   
C/C++ Source or Header  |  1997-12-28  |  1KB  |  60 lines

  1. #ifndef LIBRARIES_USERGROUP_H
  2. #define LIBRARIES_USERGROUP_H
  3.  
  4.  
  5. #define _PASSWORD_EFMT1 '_' /* extended encryption format */
  6.  
  7. #define _PASSWORD_LEN   128 /* max length, not counting NULL */
  8.  
  9. #define NGROUPS 32
  10.  
  11. #define MAXLOGNAME      32
  12.  
  13. /* old, unaligned version */
  14.  
  15. struct UserGroupCredentials_u {
  16.   long    cr_ruid;
  17.   long    cr_rgid;
  18.   unsigned short cr_umask;
  19.   long    cr_euid;
  20.   short   cr_ngroups;
  21.   long    cr_groups[NGROUPS];
  22.   struct Task *cr_session;
  23.   char    cr_login[MAXLOGNAME];
  24. };
  25.  
  26.  
  27. struct UserGroupCredentials {
  28.   long    cr_ruid;
  29.   long    cr_rgid;
  30.   unsigned short cr_umask;
  31.   unsigned short cr_pad1;
  32.   long    cr_euid;
  33.   short   cr_ngroups;
  34.   short   cr_pad2;
  35.   long    cr_groups[NGROUPS];
  36.   struct Task *cr_session;
  37.   char    cr_login[MAXLOGNAME];
  38. };
  39.  
  40. /*
  41.  * ID conversion macros between usergroup.library and MultiUser
  42.  */
  43. #define UG2MU(id) ((id) == 0 ? 65535 : (id) == -2 ? 0 : (id))
  44. #define MU2UG(id) ((id) == 65535 ? 0L : (id) == 0L ? -2L : (id))
  45.  
  46. /*
  47.  * Tags for ug_SetupContextTags()
  48.  */
  49. #define UGT_ERRNOBPTR 0x80000001
  50. #define UGT_ERRNOWPTR 0x80000002
  51. #define UGT_ERRNOLPTR 0x80000004
  52. #define UGT_ERRNOPTR(size)\
  53.   ((size == 4) ? UGT_ERRNOLPTR :\
  54.    (size == 2) ? UGT_ERRNOWPTR :\
  55.    (size == 1) ? UGT_ERRNOBPTR : 1L)
  56. #define UGT_OWNER     0x80000011
  57. #define UGT_INTRMASK  0x80000010
  58.  
  59. #endif /* LIBRARIES_USERGROUP_H */
  60.